package top.wenzz.manage.system.manage.entity;

import lombok.Data;
import top.wenzz.commons.annotation.Edit;
import top.wenzz.commons.annotation.Query;
import top.wenzz.commons.entity.DataEntity;

import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.Transient;
import javax.validation.constraints.NotNull;
import java.sql.Date;

/**
 * 加班记录
 * Created by 钟廷员 on 2017/8/8.
 */
@Entity( name = "overtime_record" )
@Data
public class OvertimeRecord extends DataEntity<OvertimeRecord> {
    @NotNull(message = "用户不能为空")
    @ManyToOne
    @Edit(value = "用户", update = false)
    @Query
    private SysUser user;

    @NotNull(message = "加班日期不能为空")
    @Edit("加班日期")
    private Date date;

    @Transient
    @Query(value = Query.ReadType.BETWEEN, queryName = "date")
    private Date[] queryDate;
}
